﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace NWebCrawler
{
    /// <summary>
    /// ArticleDetail.xaml 的交互逻辑
    /// </summary>
    public partial class ArticleDetail : Window
    {
        public string TmpTitle { get; set; }
        public string TmpContent { get; set; }

        public string TmpUrl { get; set; }

        public ArticleDetail()
        {
            InitializeComponent();
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            detailBox.Text = TmpContent;
            titleBox.Text = TmpTitle;
            urlBlock.Text = TmpUrl;
            
        }

        private void btnOK_Click(object sender, RoutedEventArgs e)
        {
            DialogResult = true;

            TmpTitle = titleBox.Text;
            TmpContent = detailBox.Text;
        }

        private void btnCancel_Click(object sender, RoutedEventArgs e)
        {
            DialogResult = false;
        }

        private void btnUrl_Click(object sender, RoutedEventArgs e)
        {
            System.Diagnostics.Process.Start(TmpUrl);
        }
    }
}
